import 'package:flutter/material.dart';
import 'package:travel/screen/flutter_screenutil.dart';

import 'colors.dart';

class StylesUtils {
  StylesUtils._();

  static const String defaultFamily = 'YaHei';

  static const String arialFamily = 'Arial';

  static double get defaultFontSize {
    return 14.sp;
  }

  static TextStyle defaultTextStyle(
      {double? fontSize, double lineHeight = 1.0, String fontFamily = defaultFamily}) {
    return TextStyle(
        fontSize: fontSize ?? defaultFontSize,
        fontFamily: fontFamily,
        fontWeight: FontWeight.normal,
        height: lineHeight,
        fontStyle: FontStyle.normal,
        color: Colors.white);
  }

  static TextStyle customTextStyle(
      {double? fontSize,
      FontWeight fontWeight = FontWeight.normal,
      String color = ColorsUtils.colorFfff,
      String fontFamily = defaultFamily,
      List<Shadow>? shadows,
      double lineHeight = 1.0}) {
    return TextStyle(
        fontSize: fontSize ?? defaultFontSize,
        fontFamily: fontFamily,
        fontWeight: FontWeight.normal,
        fontStyle: FontStyle.normal,
        shadows: shadows,
        color: ColorsUtils.parseColorFromHexString(color),
        height: lineHeight);
  }

  static TextStyle textStyle(
      {double? fontSize,
      FontWeight fontWeight = FontWeight.normal,
      Color color = Colors.white,
      String fontFamily = defaultFamily,
      TextDecoration? decoration,
      TextDecorationStyle? decorationStyle,
      Color? decorationColor,
      double lineHeight = 1.0}) {
    return TextStyle(
        fontSize: fontSize ?? defaultFontSize,
        fontFamily: fontFamily,
        fontWeight: FontWeight.normal,
        color: color,
        fontStyle: FontStyle.normal,
        decoration: decoration,
        decorationColor: decorationColor,
        decorationStyle: decorationStyle,
        height: lineHeight);
  }
}
